package com.hdax.dm.openfeign.factory;

import com.hdax.dm.entity.base.DmImage;
import com.hdax.dm.openfeign.BaseFeign;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class BaseFeignFallBackFactory implements FallbackFactory<BaseFeign> {
    @Override
    public BaseFeign create(Throwable cause) {
        return new BaseFeign() {
            @Override
            public DmImage image(Long itemId) {
                DmImage dmImage=new DmImage();
                dmImage.setImgUrl("/static/img/热门3.jpg");
                return dmImage;
            }
        };
    }
}
